<template>
	<view class="toolbar">
		<view class="item" @click="navigator">
			<text class="icon icon-1"></text>
			首页
		</view>
		<view class="item active" @tap="handleCallClick">
			<text class="icon icon-tel"></text>
			电话咨询
		</view>
	</view>
</template>

<script setup>
	const navigator = () => {
		uni.switchTab({
			url: '/pages/home/index'
		})
	}

	const emit = defineEmits('call')
	const handleCallClick = () => {
		emit('call')
	};
</script>

<style lang="scss" scoped>
	.toolbar {
		display: flex;
		align-items: center;
		text-align: center;

		.item {
			flex: 1;
			font-size: 28rpx;
			color: #666;
			padding: 32rpx;
			display: flex;
			flex-direction: column;

			.icon {
				font-size: 50rpx;
			}

			&.active {
				color: $uni-color-primary;
			}
		}
	}
</style>